package net.csdn.business.auth.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.common.domain.request.oauth.PersonalAccessTokenDTO;
import net.csdn.business.common.domain.request.oauth.PersonalAccessTokenQuery;
import net.csdn.business.common.domain.request.oauth.RevokedPersonTokenDTO;
import net.csdn.business.common.domain.vo.oauth.OauthTokenInfoVO;
import net.csdn.business.common.domain.vo.oauth.PersonalAccessTokenVO;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Auther: zhangyalei
 * @Date: 2022/12/12 13:47
 * @Description: 私人token的service
 */
public interface PersonTokenService {

    /**
     * 分页查询
     * @param query 筛选条件
     * @return
     */
    public Page<PersonalAccessTokenVO> findPageList(PersonalAccessTokenQuery query);


    /**
     * @Desc: 新增私人token
     * @Author: zhangyalei
     * @Date: 2022/12/19 17:44
     */
    public PersonalAccessTokenVO addPersonalAccess(PersonalAccessTokenDTO personToken);

    /**
     * @Desc: 根据tokenId撤销私人token
     * @Author: zhangyalei
     * @Date: 2022/12/19 17:44
     */
    public Integer revokedPersonToken(RevokedPersonTokenDTO params);

    /**
     * @Desc: 根据userId本人名下所有私人token
     * @Author: zhangyalei
     * @Date: 2022/12/19 17:44
     */
    public Integer revokedAllPersonToken(RevokedPersonTokenDTO params);


    /**
     * @Desc: 根据token获取token包含的用户信息、以及scope
     * @Author: zhangyalei
     * @Date: 2023/03/16 17:00
     */
    public OauthTokenInfoVO getInfo(String token);
}
